package com.chexiehui.jc.mvp.mine;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BaseView;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 账号管理
 * @Auth SongJun
 * @Date 2019/03/28 15:11
 **/
public interface AccountSettingCovenant {

    interface View extends BaseView {
        void onUpdateAvatarSuccess(BaseModel<String> successResult);
        void onUpdateAvatarFailure(BaseModel<Object> failureResult);

        void onUpdateNameSuccess(BaseModel<String> successResult);
        void onUpdateNameFailure(BaseModel<Object> failureResult);

        void onUpdateRemarkSuccess(BaseModel<String> successResult);
        void onUpdateRemarkFailure(BaseModel<Object> failureResult);

        void onUpdateBackgroundImgSuccess(BaseModel<String> successResult);
        void onUpdateBackgroundImgFailure(BaseModel<Object> failureResult);
    }

    interface Stores {

        @FormUrlEncoded
        @POST(Constants.URL_MINE_UPDATE_AVATAR)
        Observable<BaseModel<String>> updateAvatar(@Field("path") String path);
        @FormUrlEncoded
        @POST(Constants.URL_MINE_UPDATE_NAME)
        Observable<BaseModel<String>> updateName(@Field("name") String name);
        @FormUrlEncoded
        @POST(Constants.URL_MINE_UPDATE_REMARK)
        Observable<BaseModel<String>> updateRemark(@Field("remark") String remark);
        @FormUrlEncoded
        @POST(Constants.URL_MINE_UPDATE_BACKGROUND_IMG)
        Observable<BaseModel<String>> updateBackgroundImg(@Field("path") String path);
    }

    interface Presenter {
        void updateAvatar(String avatar);
        void updateName(String name);
        void updateRemark(String remark);
        void updateBackgroundImg(String path);
    }

}